import { Avatar } from 'antd';
import { UserOutlined } from '@ant-design/icons';
import styles from './index.scss';

interface AvatarInfoProps {
    name?: string;
    address?: string;
    avatar?: string;
}

export default function AvatarInfo(props: AvatarInfoProps) {
    return (
        <div className={styles.root}>
            <Avatar
                icon={<UserOutlined />}
                className={styles.avatar}
                src={props.avatar}
            >
                {props.name?.substring(0, 1)}
            </Avatar>

            <span className={styles.name}>{props.name}</span>
            <span className={styles.address}>地址：{props.address}</span>
        </div>
    );
}
